package com.indexingsystem.system.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.indexingsystem.boss.Vo.TaskInnerTextListReqVo;
import com.indexingsystem.boss.admin.mapper.IdxTaskInnertextMapper;
import com.indexingsystem.boss.common.PagedResult;
import com.indexingsystem.boss.entity.IdxTaskInnertext;
import com.indexingsystem.boss.utils.BeanUtils;
import com.indexingsystem.system.service.IdxTaskInnertextService;

@Service
public class IdxTaskInnertextServiceImpl  implements IdxTaskInnertextService {
	@Resource
	private IdxTaskInnertextMapper idxTaskInnertextMapper;
	@Override
	public int deleteByPrimaryKey(String relationId) {
		// TODO Auto-generated method stub
		return idxTaskInnertextMapper.deleteByPrimaryKey( relationId );
	}

	@Override
	public int insert(IdxTaskInnertext record) {
		// TODO Auto-generated method stub
		return idxTaskInnertextMapper.insert( record );
	}

	@Override
	public int insertSelective(IdxTaskInnertext record) {
		// TODO Auto-generated method stub
		return idxTaskInnertextMapper.insertSelective( record );
	}

	@Override
	public IdxTaskInnertext selectByPrimaryKey(String relationId) {
		// TODO Auto-generated method stub
		return idxTaskInnertextMapper.selectByPrimaryKey( relationId );
	}

	@Override
	public int updateByPrimaryKeySelective(IdxTaskInnertext record) {
		// TODO Auto-generated method stub
		return idxTaskInnertextMapper.updateByPrimaryKeySelective( record );
	}

	@Override
	public int updateByPrimaryKey(IdxTaskInnertext record) {
		// TODO Auto-generated method stub
		return idxTaskInnertextMapper.updateByPrimaryKey( record );
	}

	@Override
	public int getTaskInnerTextListCount(TaskInnerTextListReqVo taskInnerTextListReqVo) {
		// TODO Auto-generated method stub
		return idxTaskInnertextMapper.getTaskInnerTextListCount( taskInnerTextListReqVo );
	}

	@Override
	public  PagedResult<IdxTaskInnertext> getTaskInnerTextList(TaskInnerTextListReqVo taskInnerTextListReqVo) {
		// TODO Auto-generated method stub
		  Integer pageNo = taskInnerTextListReqVo.getPageNo() == null ? 1 : taskInnerTextListReqVo.getPageNo();
	        Integer pageSize = taskInnerTextListReqVo.getPageSize() == null ? 10 : taskInnerTextListReqVo.getPageSize();
	        // startPage是告诉拦截器说我要开始分页了。分页参数是这两个。
	        PageHelper.startPage( pageNo, pageSize );
	        return BeanUtils.toPagedResult( idxTaskInnertextMapper.getTaskInnerTextList( taskInnerTextListReqVo ) );
	}

	@Override
	public Integer deleteByIdBatch(List<String> list) {
		// TODO Auto-generated method stub
		return idxTaskInnertextMapper.deleteByIdBatch( list );
	}

}
